import { useEffect, useState } from "react";

const { getChannelAPI } = require("@/api/article");

export const useChannel = () => {
  const [channelList, setChannelList] = useState([]);
  useEffect(() => {
    const getChannelList = async () => {
      const response = await getChannelAPI();
      setChannelList(response.data.channels);
    };
    getChannelList();
  }, []);
  return {
    channelList,
    setChannelList,
  };
};
